body {
    font-family: 'Inter', system-ui, sans-serif;
    color: #1F2937;
    background-color: #F9FAFB;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 网格布局 */
.grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .grid-container {
        grid-template-columns: 2fr 1fr;
    }
}

/* 卡片样式 */
.contacts-card,
.form-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid #E5E7EB;
    background-color: #F9FAFB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.card-header h2 i {
    margin-right: 8px;
    color: #4F46E5;
}

.card-footer {
    padding: 16px;
    border-top: 1px solid #E5E7EB;
    background-color: #F9FAFB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 搜索框 */
.search-container {
    position: relative;
    width: 100%;
    max-width: 240px;
}

.search-container input {
    padding: 8px 12px 8px 36px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
}

.search-container input:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.search-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
}

/* 空状态 */
#empty-state {
    padding: 64px 0;
    text-align: center;
}

.empty-icon {
    width: 64px;
    height: 64px;
    background-color: rgba(79, 70, 229, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.empty-icon i {
    font-size: 24px;
    color: #4F46E5;
}

#empty-state h3 {
    font-size: 18px;
    font-weight: 500;
    color: #6B7280;
}

#empty-state p {
    font-size: 14px;
    color: #9CA3AF;
    margin-top: 8px;
}

.contact-item {
    padding: 16px;
    margin: 5px 10px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.contact-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.contact-info h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.contact-details {
    font-size: 14px;
    color: #6B7280;
}

.contact-details p {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.contact-details i {
    margin-right: 8px;
    color: #9CA3AF;
    width: 16px;
    text-align: center;
}

.contact-actions {
    display: flex;
    gap: 4px;
}

.contact-actions button {
    padding: 6px;
    border-radius: 4px;
    color: #9CA3AF;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.contact-actions button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.contact-actions .edit-btn:hover {
    color: #3B82F6;
}

.contact-actions .delete-btn:hover {
    color: #EF4444;
}

/* 表单样式 */
#contact-form {
    padding: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.input-container {
    position: relative;
}

.input-container i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
}

.input-container input {
    width: calc(100% - 50px);
    padding: 8px 12px 8px 36px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
}

.input-container textarea {
    padding: 8px 12px 8px 36px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
}

.input-container input:focus,
.input-container textarea:focus {
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.input-container textarea {
    resize: none;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions button {
    flex: 1;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#submit-btn {
    background-color: #10B981;
    color: white;
    border: none;
}

#submit-btn:hover {
    background-color: #059669;
}

#cancel-btn {
    background-color: white;
    color: #1F2937;
    border: 1px solid #D1D5DB;
}

#cancel-btn:hover {
    background-color: #F9FAFB;
}

/* 编辑状态下的表单按钮 */
#contact-form.edit-mode #submit-btn {
    background-color: #F59E0B;
}

#contact-form.edit-mode #submit-btn:hover {
    background-color: #D97706;
}

/* 对话框 */
#confirm-dialog {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#confirm-dialog.active {
    opacity: 1;
    pointer-events: auto;
}

.dialog-content {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#confirm-dialog.active .dialog-content {
    transform: scale(1);
}

.dialog-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.dialog-content p {
    color: #6B7280;
    margin-bottom: 24px;
}

.dialog-actions {
    display: flex;
    gap: 12px;
}

.dialog-actions button {
    flex: 1;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#dialog-confirm {
    background-color: #EF4444;
    color: white;
    border: none;
}

#dialog-confirm:hover {
    background-color: #DC2626;
}

#dialog-cancel {
    background-color: white;
    color: #1F2937;
    border: 1px solid #D1D5DB;
}

#dialog-cancel:hover {
    background-color: #F9FAFB;
}

/* 通知提示 */
#notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #1F2937;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transform: translateY(40px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
}

#notification.active {
    transform: translateY(0);
    opacity: 1;
}

#notification i {
    margin-right: 8px;
    font-size: 18px;
}

#notification.success i {
    color: #10B981;
}

#notification.error i {
    color: #EF4444;
}

#notification.info i {
    color: #3B82F6;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.hidden {
    display: none !important;
}

#clear-all {
    background-color: red;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
}

#clear-all:hover {
    background-color: rgb(184, 0, 0);
    transition: 0.25s;
}

#sort-name {
    background-color: white;
    color: #1F2937;
    border: 1px solid #D1D5DB;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 8px;
}

#sort-name:hover {
    background-color: #cecece;
    transition: 0.25s;
}